﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Web.Security;

namespace WebLib.AuthorizeService
{
    public class DefaultFormsAuthentication : IFormsAuthentication
    {
        public void SignIn(int userKey, string userId, string userName, string[] userRoles)
        {
            var auth = new Authentication(new UserDataModel
            {
                UserId = userId,
                UserKey = userKey,
                UserName = userName,
                UserRoles = userRoles
            });
            auth.SetTicket();
        }

        public void SignOut()
        {
            FormsAuthentication.SignOut();
        }
    }
}
